# Maintainer: Gaetan Bisson <bisson@archlinux.org>
# Maintainer: Jan de Groot <jgc@archlinux.org>
# Contributor: mgushee

pkgname=djvulibre
pkgver=3.5.27
pkgrel=4
pkgdesc="Suite to create, manipulate and view DjVu ('déjà vu') documents"
url='http://djvu.sourceforge.net/'
arch=('x86_64')
license=('GPL2')
makedepends=('librsvg')
depends=('libtiff' 'hicolor-icon-theme')
source=("https://downloads.sourceforge.net/project/djvu/DjVuLibre/${pkgver}/djvulibre-${pkgver}.tar.gz")
sha256sums=('e69668252565603875fb88500cde02bf93d12d48a3884e472696c896e81f505f')

conflicts=('libdjvu')
provides=("libdjvu=${pkgver}")
replaces=('libdjvu')

build() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	./autogen.sh
	./configure --prefix=/usr --disable-desktopfiles
	make
}

package() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	make DESTDIR="${pkgdir}" install
	for sz in 22 32 48 64; do
		install -Dm644 desktopfiles/prebuilt-hi${sz}-djvu.png "${pkgdir}/usr/share/icons/hicolor/${sz}x${sz}/mimetypes/image-vnd.djvu.mime.png"
	done
}
